﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevDL.UserLimit.IDAL;
using DevDL.UserLimit.DALFactory;
using DevDL.UserLimit.Models;

namespace DevDL.UserLimit.BLL
{
    public class UserInfoBLL
    {
        private IUserInfoDAL iuserInfoDAL = DataAccess.CreateUserInfoDAL();
        /// <summary>
        /// 登录系统
        /// </summary>
        /// <param name="str1"></param>
        /// <param name="str2"></param>
        /// <param name="userInfo"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool CheckUser(string str1,string str2,ref UserInfo userInfo,ref string msg)
        {
            UserInfo userInfo1 = iuserInfoDAL.GetUserInfoByUserId(str1);
            if (userInfo1==null)
            {
                msg = "用户名错误";
                return false;
            }
            if (userInfo1.LoginPwd!=str2)
            {
                msg = "密码错误";
                return false;
            }
            userInfo = userInfo1;
            return true;
        }
    }
}
